package com.hy.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hy.hello.HelloSender1;

@RestController
@RequestMapping("/rabbit")
public class RabbitTest {
	
	public int count = 200;

	@Autowired
    private HelloSender1 helloSender1;
    
	@RequestMapping("/hello")
    public String hello() {
        return helloSender1.send()+"";
    }
	
	@RequestMapping("/test")
    public String test() throws Exception {
		if(count > 0){
			System.out.println(count);
			Thread.sleep(1000);
			count--;
		}
        return count+"";
    }
    
}
